package com.sp.system.service.impl;

import java.util.List;
import com.sp.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sp.system.mapper.SysParkingSpotMapper;
import com.sp.system.domain.SysParkingSpot;
import com.sp.system.service.ISysParkingSpotService;

/**
 * 停车位Service业务层处理
 * 
 *
 * @date 2024-11-24
 */
@Service
public class SysParkingSpotServiceImpl implements ISysParkingSpotService 
{
    @Autowired
    private SysParkingSpotMapper sysParkingSpotMapper;

    /**
     * 查询停车位
     * 
     * @param id 停车位主键
     * @return 停车位
     */
    @Override
    public SysParkingSpot selectSysParkingSpotById(Long id)
    {
        return sysParkingSpotMapper.selectSysParkingSpotById(id);
    }

    /**
     * 查询停车位列表
     * 
     * @param sysParkingSpot 停车位
     * @return 停车位
     */
    @Override
    public List<SysParkingSpot> selectSysParkingSpotList(SysParkingSpot sysParkingSpot)
    {
        return sysParkingSpotMapper.selectSysParkingSpotList(sysParkingSpot);
    }

    /**
     * 新增停车位
     * 
     * @param sysParkingSpot 停车位
     * @return 结果
     */
    @Override
    public int insertSysParkingSpot(SysParkingSpot sysParkingSpot)
    {
        sysParkingSpot.setCreateTime(DateUtils.getNowDate());
        return sysParkingSpotMapper.insertSysParkingSpot(sysParkingSpot);
    }

    /**
     * 修改停车位
     * 
     * @param sysParkingSpot 停车位
     * @return 结果
     */
    @Override
    public int updateSysParkingSpot(SysParkingSpot sysParkingSpot)
    {
        sysParkingSpot.setUpdateTime(DateUtils.getNowDate());
        return sysParkingSpotMapper.updateSysParkingSpot(sysParkingSpot);
    }

    /**
     * 批量删除停车位
     * 
     * @param ids 需要删除的停车位主键
     * @return 结果
     */
    @Override
    public int deleteSysParkingSpotByIds(Long[] ids)
    {
        return sysParkingSpotMapper.deleteSysParkingSpotByIds(ids);
    }

    /**
     * 删除停车位信息
     * 
     * @param id 停车位主键
     * @return 结果
     */
    @Override
    public int deleteSysParkingSpotById(Long id)
    {
        return sysParkingSpotMapper.deleteSysParkingSpotById(id);
    }
}
